package com.ruoyi.control.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.control.mapper.JhjsOneMapper;
import com.ruoyi.control.domain.JhjsOne;
import com.ruoyi.control.service.IJhjsOneService;

/**
 * 401机巷局扇Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class JhjsOneServiceImpl extends ServiceImpl<JhjsOneMapper, JhjsOne> implements IJhjsOneService //修改
{
    @Autowired
    private JhjsOneMapper jhjsOneMapper;

    /**
     * 查询401机巷局扇
     * 
     * @param tagName 401机巷局扇主键
     * @return 401机巷局扇
     */
    @Override
    public JhjsOne selectJhjsOneByTagName(String tagName)
    {
        return jhjsOneMapper.selectJhjsOneByTagName(tagName);
    }

    /**
     * 查询401机巷局扇列表
     * 
     * @param jhjsOne 401机巷局扇
     * @return 401机巷局扇
     */
    @Override
    public List<JhjsOne> selectJhjsOneList(JhjsOne jhjsOne)
    {
        return jhjsOneMapper.selectJhjsOneList(jhjsOne);
    }

    /**
     * 新增401机巷局扇
     * 
     * @param jhjsOne 401机巷局扇
     * @return 结果
     */
    @Override
    public int insertJhjsOne(JhjsOne jhjsOne)
    {
        return jhjsOneMapper.insertJhjsOne(jhjsOne);
    }

    /**
     * 修改401机巷局扇
     * 
     * @param jhjsOne 401机巷局扇
     * @return 结果
     */
    @Override
    public int updateJhjsOne(JhjsOne jhjsOne)
    {
        jhjsOne.setUpdateTime(DateUtils.getNowDate());
        return jhjsOneMapper.updateJhjsOne(jhjsOne);
    }

    /**
     * 批量删除401机巷局扇
     * 
     * @param tagNames 需要删除的401机巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteJhjsOneByTagNames(String[] tagNames)
    {
        return jhjsOneMapper.deleteJhjsOneByTagNames(tagNames);
    }

    /**
     * 删除401机巷局扇信息
     * 
     * @param tagName 401机巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteJhjsOneByTagName(String tagName)
    {
        return jhjsOneMapper.deleteJhjsOneByTagName(tagName);
    }
    /**
     * 查询前端显示数据
     * @return
     */
    @Override
    public List<JhjsOne> getList() {
        List<JhjsOne> jhjsOneList = new ArrayList<>();
        List<String> fanData = Arrays.asList("JKMS","JXMS","YKMS","ZJDY","ZJYJDJDY","ZJEJDJDY","YTJWZ","ZJDJWD","FL","FS","BJDY","BJDJWD","BJYJDJDY","BJEJDJDY","JDJWZ");
        for (String fanDatum : fanData) {
            JhjsOne jhjsOne = jhjsOneMapper.selectJhjsOneByTagName(fanDatum);
            jhjsOneList.add(jhjsOne);
        }
        return jhjsOneList;
    }
}
